<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue2.js"></script>
</head>
<body>
    <div id="app">
     <input type="text" v-model='userForm.username'>
     <input type="button" value="+">
     <input type="text" v-model='userForm.password'>
     <input type="button" value="=" @click='getAll'>
     <input type="text" v-model='count'>

    </div>
</body>
<script>
 var bnm = new Vue({
     el:'#app',
     data:{
         //输出的数据
       userForm:{
           username:'',
           password:''
       },
       //得到的数据
       count:''
     },
     methods:{
         getAll(){
             this.count=Number(this.userForm.username)+Number(this.userForm.password)
         }
     }
 })


</script>

</html>